package com.nwpu.coursesupport.mapper;

import java.util.List;

import com.nwpu.coursesupport.criteria.CourseSearchCriteria;
import com.nwpu.coursesupport.entity.Course;
import com.nwpu.coursesupport.entity.Teacher;
import com.nwpu.coursesupport.view.CourseGradeRateView;
import com.nwpu.coursesupport.view.CourseView;
import org.apache.ibatis.annotations.Select;

public interface CourseMapper extends BaseMapper<Course>{
    
	public List<CourseView> findView(CourseSearchCriteria sc);
    
	public CourseGradeRateView getRate(int id);
	
	public boolean updateRate(Course course);
	
	public Teacher getTeacherByCourseId(int id);

	@Select("select id from course where name = #{name}")
    public Integer findIdByName(String name);

	@Select("select * from course where id = #{courseID}")
	public Course getCourseByID(Integer courseID);
}